<?php
/**
 * pemilu
 * copyright (c) 2013 abie
 *
 * @author abie
 * @date 12/20/13 1:17 AM
 */

class Calon extends MyModel {

    private $nomor, $nama, $foto, $pemilihan;

    /** @var Calon */
    private static $model = null;

    private $data;


    public static function model() {
        if (self::$model == null) {
            self::$model = new Calon();
            self::$model->data = include(__DIR__ . '/../data/calon.php');
        }
        return self::$model;
    }

    /**
     * Returns the list of attribute names of the model.
     *
     * @return array list of attribute names.
     */
    public function attributeNames()
    {
        // TODO: Implement attributeNames() method.
    }

    /**
     * @return string[]
     */
    protected function getAllKeys()
    {
        return array_keys($this->data);
    }

    /**
     * @param $pk
     * @return MyModel
     */
    public function findByPk($pk)
    {
        $data = $this->data[$pk];
        $calon = new Calon();

    }
}